<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

  <div class="layui-form-item">
    <label class="layui-form-label">网站名称</label>
    <div class="layui-input-inline" style="width: 350px;">
      <script type="text/html" template>
        <input type="text" name="title" value="{{ d.params.title || '' }}" lay-verify="required" placeholder="网站名称" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">URL</label>
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="url" value="{{ d.params.url || '' }}" lay-verify="required" placeholder="http://" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">说明</label>
    <div class="layui-input-inline" style="width: 80%;">
      <script type="text/html" template>
        <textarea name="remark" placeholder="" class="layui-textarea">{{ d.params.remark || '' }}</textarea>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline" style="width: 150px;">
      <script type="text/html" template>
        <input type="text" name="sort" value="{{ d.params.sort || '' }}" lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="checkbox" lay-filter="status" name="status" value="1" lay-skin="switch" lay-text="显示|隐藏" {{ d.params.status !== 0 ? 'checked' : '' }} >
      </script>
    </div>
  </div>

  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || '' }}">
  </script>

  <script type="text/html" template>
    <input type="hidden" name="lang" value="{{ layui.data('lang').lang }}">
  </script>

  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>
<script>
  layui.use(['admin', 'form', 'upload'], function () {
    var $ = layui.$
      , form = layui.form
      , upload = layui.upload;

    //上传头像
    upload.render({
      elem: '#layuiadmin-upload-useradmin'
      , url: './json/upload/demo.js'
      , accept: 'images'
      , method: 'get'
      , acceptMime: 'image/*'
      , done: function (res) {
        $(this.item).prev("div").children("input").val(res.data.src)
      }
    });

    form.on('radio(status)', function (data) {
      // console.log(data.elem); //得到radio原始DOM对象
      console.log(data.value); //被点击的radio的value值
    });

  })
</script>